/*
 * @Author: 华芊芊 huaqianqian@yeah.net
 * @Date: 2023-09-14 11:04:15
 * @LastEditors: 华芊芊 huaqianqian@yeah.net
 * @LastEditTime: 2023-09-14 11:04:25
 * @FilePath: \zmglpt-ui-screen\src\utils\message.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Message } from 'element-ui'
let messageInstance = null
let mainMessage = function Toast(message, type, duration) {
  if (messageInstance) {
    messageInstance.close()
  }
  messageInstance = Message({
    type: type || 'success',
    message: message || '未知错误',
    duration: duration || 2000,
  })
}
export const Toast = mainMessage
